package com.kalvan.system.iface;

import com.kalvan.core.response.Result;
import com.kalvan.system.bean.req.LogDto;
import com.kalvan.system.bean.res.DictDto;
import com.kalvan.system.constant.SystemReturnCode;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author chenliang
 */
@FeignClient(name = SystemReturnCode.APPLICATION_NAME, contextId = "IBaseRemote")
public interface IBaseRemote {
    /**
     * 获取字典
     *
     * @param dictType 字典类型
     * @return Map
     */
    @RequestMapping(value = "getDictMap", method = RequestMethod.POST)
    Result<Map<String, DictDto>> getDictMap(@RequestParam("dictType") String dictType);

    /**
     * 写入日志
     *
     * @param log 待记录日志信息
     * @return true or false
     */
    @RequestMapping(value = "insertLog", method = RequestMethod.POST)
    Result insertLog(@RequestBody LogDto log);
}
